﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>金额流水表</title>
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/demo.css">
    <link href="~/Content/Styles/Manage_Order.css" rel="stylesheet" />
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
    <script src="~/Content/jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>

    <script>
        $(function () {
            //initTable();//初始化表格
            acccertype();//初始化证件类型 
            waltfolwtype();//初始化流水类型
            waltname();//初始化钱包
            Dep();//组织结构
        });

        //初始化表格 
        function initTable() {
            $('#load').datagrid({
                iconCls: 'icon-user',
                loadMsg: '数据加载中...',
                nowrap: true,
                autoRowHeight: true,
                striped: true,
                url: '/FlowMon/GetAllMon',
                sortName: 'FlowMonID',
                sortOrder: 'asc',
                border: true,
                remoteSort: false,
                idField: 'FlowMonID',
                pageSize: 10,
                singleSelect: true,
                pagination: true,
                rownumbers: true,
                columns: [[
                    { field: 'FlowMonID', title: '金额流水编号', width: 100, sortable: true, align: 'center' },
                    { field: 'AccNum', title: '用户帐号', width: 80, sortable: true, align: 'center' },
                    { field: 'AccName', title: "用户姓名", width: 100, sortable: true, align: 'center', },
                    {field: 'WaltFlowTypeName', title: "流水类型", width: 150, sortable: true, align: 'center' },
                    { field: 'WaltName', title: "钱包", width: 150, sortable: true, align: 'center' },
                    {
                        field: 'WaltNowNub', title: '发生前钱包余额（元）', width: 150, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                                return val/100;
                        }
                    },
                    {
                        field: 'WaltHaveNub', title: '本次余额变更（元）', width: 130, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                            return val/100;
                        }
                    },
                    {
                        field: 'WaltEndNub', title: '发生后钱包余额（元）', width: 130, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                            return val/100;
                        }
                    },
                    { field: 'WaltFlowTime', title: '发生时间', width: 150, sortable: true, align: 'center' },
                    { field: 'OperNum', title: '经办人', width: 80, sortable: true, align: 'center' },
                    { field: 'PayID', title: '第三方支付流水编号', width: 150, sortable: true, align: 'center' },
                    { field: 'OrdrID', title: '订单编号', width: 80, sortable: true, align: 'center' },
                    { field: 'WaltBZ', title: '备注', width: 150, sortable: true, align: 'center' }
                ]],
                toolbar: '#tb'
            });
        }

        //证件类型
        function acccertype() {
            $.get("/FlowMon/getacccertype", {}, function (database) {
                $('#ZjType').combobox({
                    valueField: 'DictKey',
                    textField: 'DictName',
                    data: database
                });
            })
        }
        //钱包
        function waltname() {
            $.get("/FlowMon/getwaltname", {}, function (database) {
                var a = {
                    "WaltID": "",
                    "WaltName": "全部",
                }

                //database.push(a)
                database.splice(0, 0, a); // 将全部的选项放在最前
                $('#WaltName').combobox({
                    valueField: 'WaltID',//WaltID
                    textField: 'WaltName',
                    value: '',
                    text: '全部',
                    data: database
                })
            })
        }
        //组织结构
        function Dep() {
            $('#Zzjiegou').combotree({
                url: "/FlowMon/getdep",
                method: 'get',
                multiple: true,
            });
        }
        //流水类型
        function waltfolwtype() {
            $.get("/FlowMon/getwaltflowtype", {}, function (database) {

                var a = {
                    "DictKey": "",
                    "DictName": "全部",
                }

                //database.push(a)
                database.splice(0, 0, a); // 将全部的选项放在最前
                $('#WaltFlowType').combobox({
                    valueField: 'DictKey',
                    textField: 'DictName',
                    value: '',
                    text: '全部',
                    data: database
                })
            })
        }

        //搜索
        function Search() {
            //var AccName = $('#AccName').textbox('getValue');//姓名 string
            //var AccCall = $('#CallNumber').textbox('getValue');//手机号 string 
            //var AccCerNub = $('#ZjNumber').textbox('getValue'); //证件号码 string
            //var DepID =$('#Zzjiegou').combotree('getValue');//组织结构  undefined
            var AccID = $('#AccID').textbox('getValue');//个人编号 string
            //var AccCerType = $('#ZjType').combobox('getValue');//证件类型 string
            var WaltFlowType = $('#WaltFlowType').combobox('getValue');//流水类型  string
            var WaltID = $('#WaltName').combobox('getValue');//钱包 string
            var WaltFlowEtime = $('#WaltFlowEtime').datebox('getValue');//发生时间 string
            var WaltFlowStime = $('#WaltFlowStime').datebox('getValue');//发生时间 string
            //alert(AccID + "--" + WaltID)
            if (AccID != null || WaltFlowStime != ""|| WaltFlowEtime != "") {
                $('#load').datagrid({
                    iconCls: 'icon-user',
                    loadMsg: '数据加载中...',
                    nowrap: true,
                    autoRowHeight: true,
                    striped: true,
                    url: '/FlowMon/SearchMon?&AccID=' + AccID + '&WaltFlowType=' + WaltFlowType + '&WaltID=' + WaltID + '&WaltFlowStime=' + WaltFlowStime + '&WaltFlowEtime=' + WaltFlowEtime,
                    sortName: 'FlowMonID',
                    sortOrder: 'asc',
                    border: true,
                    remoteSort: false,
                    idField: 'FlowMonID',
                    pageSize: 10,
                    singleSelect: true,
                    pagination: true,
                    rownumbers: true,
                    columns: [[
                        { field: 'FlowMonID', title: '金额流水编号', width: 100, sortable: true, align: 'center' },
                        { field: 'AccNum', title: '用户帐号', width: 80, sortable: true, align: 'center' },
                        { field: 'AccName', title: "用户姓名", width: 100, sortable: true, align: 'center', },
                        { field: 'WaltFlowTypeName', title: "流水类型", width: 150, sortable: true, align: 'center' },
                        { field: 'WaltName', title: "钱包", width: 150, sortable: true, align: 'center' },
                        {
                            field: 'WaltNowNub', title: '发生前钱包余额（元）', width: 150, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                                return val / 100;
                            }
                        },
                        {
                            field: 'WaltHaveNub', title: '本次余额变更（元）', width: 130, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                                return val / 100;
                            }
                        },
                        {
                            field: 'WaltEndNub', title: '发生后钱包余额（元）', width: 130, sortable: true, align: 'center', formatter: function (val, rowdata, index) {
                                return val / 100;
                            }
                        },
                        { field: 'WaltFlowTime', title: '发生时间', width: 150, sortable: true, align: 'center' },
                        { field: 'OperNum', title: '经办人', width: 80, sortable: true, align: 'center' },
                        { field: 'PayID', title: '第三方支付流水编号', width: 150, sortable: true, align: 'center' },
                        { field: 'OrdrID', title: '订单编号', width: 80, sortable: true, align: 'center' },
                        { field: 'WaltBZ', title: '备注', width: 150, sortable: true, align: 'center' }
                    ]],
                    toolbar: '#tb'
                });
               
            } else {
                $.messager.alert("友情提示", "至少填写一个正确的搜索条件");
                return;
              
            }

        }

        //清空文本框中的值
        function ClearText() {

        }
    </script>

</head>
<body style="padding: 0;">

    <!--表格加载S-->
    <div>
        <table id="load" style="width: auto;"></table>
    </div>
    <!--表格加载E-->

    <!--工具栏S-->
    <div id="tb" style="padding: 5px; height: auto">
        <div style="margin-bottom: 5px">
            查询条件：&nbsp;
            @*姓名：<input id="AccName" class="easyui-textbox" style="width: 100px" />&nbsp;*@
            <!--手机号：<input id="CallNumber" class="easyui-textbox" style="width: 100px" />&nbsp;
            证件类型：<input id="ZjType" class="easyui-combobox" style="width: 100px" />&nbsp;
            证件号：<input id="ZjNumber" class="easyui-textbox" style="width: 100px" /><br/>
            组织结构：<input id="Zzjiegou" class="easyui-combotree" style="width: 150px" />&nbsp;-->
            用户帐号：<input id="AccID" class="easyui-textbox" style="width: 100px" />&nbsp;
            流水类型：<input id="WaltFlowType" class="easyui-combobox" style="width: 100px" />&nbsp;
            钱包：<input id="WaltName" class="easyui-combobox" style="width: 100px" />&nbsp;
            开始时间:&nbsp;<input id="WaltFlowStime" class="easyui-datebox" style="width: 120px">&nbsp;
            到：<input id="WaltFlowEtime" class="easyui-datebox" style="width: 120px">
			<a href="#" class="easyui-linkbutton" onclick="Search()" iconcls="icon-search">查询</a>
        </div>
    </div>
    <!--工具栏E-->

</body>
</html>
